import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './component/login/login.component';
import { HomeComponent } from './component/home/home.component';
import { PermissionsComponent } from './component/permissions/permissions.component';
import { AuditComponent } from './component/audit/audit.component';
import { DesignComponent } from './component/design/design.component';
import { EmpDesignComponent } from './component/emp-design/emp-design.component';
import { EmpProgramComponent } from './component/emp-program/emp-program.component';
import { EmpProcessComponent } from './component/emp-process/emp-process.component';
import { EmpKufangComponent } from './component/emp-kufang/emp-kufang.component';
import { EmpZhijianComponent } from './component/emp-zhijian/emp-zhijian.component';
import { EmpZuzhuangComponent } from './component/emp-zuzhuang/emp-zuzhuang.component';
import { EmpZongjianComponent } from './component/emp-zongjian/emp-zongjian.component';
// import { EmpChuhuoComponent } from './component/emp-chuhuo/emp-chuhuo.component';
// import { EmpYanshouComponent } from './component/emp-yanshou/emp-yanshou.component';
import { PermissionsUserinfoComponent } from './component/permissions-userinfo/permissions-userinfo.component';
import { PermissionsCNCComponent } from './component/permissions-cnc/permissions-cnc.component';
import { KufangComponent } from './component/kufang/kufang.component';
import { ProcessComponent } from './component/process/process.component';
import { ProgramComponent } from './component/program/program.component';
import { YanshouComponent } from './component/yanshou/yanshou.component';
import { ZhijianComponent } from './component/zhijian/zhijian.component';
import { ZuzhuangComponent } from './component/zuzhuang/zuzhuang.component';
import { JiagongComponent } from './component/jiagong/jiagong.component';
import { CNCComponent } from './component/cnc/cnc.component';
import { EmpJiagongComponent } from './component/emp-jiagong/emp-jiagong.component';
import { ZhijianChildComponent } from './component/zhijian-child/zhijian-child.component';
import { PermissionsCNCjiagongComponent } from './component/permissions-cncjiagong/permissions-cncjiagong.component';
import { RukuComponent } from './component/ruku/ruku.component';
import { PaijianComponent } from './component/paijian/paijian.component';
import { LingliaoComponent } from './component/lingliao/lingliao.component';
import { WuliaofafangComponent } from './component/wuliaofafang/wuliaofafang.component';
import { RukuManageComponent } from './component/ruku-manage/ruku-manage.component';
import { BeipinmsgComponent } from './component/beipinmsg/beipinmsg.component';
import { ChangshangmsgComponent } from './component/changshangmsg/changshangmsg.component';
import { ManageRukuComponent } from './component/manage-ruku/manage-ruku.component';
import { KanbanManageComponent } from './component/kanban-manage/kanban-manage.component';
import { BaobiaoComponent } from './component/baobiao/baobiao.component';
import { ZongjihuaComponent } from './component/zongjihua/zongjihua.component';
import { DesignProcessComponent } from './component/design-process/design-process.component';
import { ProgramProcessComponent } from './component/program-process/program-process.component';
import { JiagongProcessComponent } from './component/jiagong-process/jiagong-process.component';
import { ZuzhuangProcessComponent } from './component/zuzhuang-process/zuzhuang-process.component';
import { PinjianProcessComponent } from './component/pinjian-process/pinjian-process.component';
import { BeiliaoProcessComponent } from './component/beiliao-process/beiliao-process.component';
import { ZongjianProcessComponent } from './component/zongjian-process/zongjian-process.component';
import { PaibanComponent } from './component/paiban/paiban.component';
import { AutoPaibanComponent } from './component/auto-paiban/auto-paiban.component';
import { AddtaskComponent } from './component/addtask/addtask.component';
import { PaibansetComponent } from './component/paibanset/paibanset.component';
import { ZjfsComponent } from './component/zjfs/zjfs.component';
import { LirunComponent } from './component/lirun/lirun.component';
import { ZhijvleixingsetComponent } from './component/zhijvleixingset/zhijvleixingset.component';
import { DeleteComponent } from './component/delete/delete.component';




const routes: Routes = [
  { path: 'login', component: LoginComponent },
  {
    path: 'home', component: HomeComponent,
    children: [
      {
        path: 'audit', component: AuditComponent,
        children: [
          { path: 'design', component: DesignComponent },
          { path: 'kufang', component: KufangComponent },
          { path: 'process', component: ProcessComponent },
          { path: 'program', component: ProgramComponent },
          { path: 'yanshou', component: YanshouComponent },
          { path: 'zhijian', component: ZhijianComponent },
          { path: 'zuzhuang', component: ZuzhuangComponent },
          { path: 'jiagong', component: JiagongComponent },
          { path: 'manageRuku', component: ManageRukuComponent},
          { path: 'delete', component: DeleteComponent},

          { path: '**', redirectTo: 'design' }
        ]
      },
      { path: 'empDesign', component: EmpDesignComponent },
      { path: 'empProgram', component: EmpProgramComponent },
      { path: 'empProcess', component: EmpProcessComponent },
      { path: 'empZhijian', component: EmpZhijianComponent },
      { path: 'empJiagong', component: EmpJiagongComponent },
      { path: 'empZuzhuang', component: EmpZuzhuangComponent },
      { path: 'empZongjian', component: EmpZongjianComponent },

      // { path: 'empChuhuo', component: EmpChuhuoComponent },
      // { path: 'empYanshou', component: EmpYanshouComponent },
      { path: 'ruku', component: RukuComponent },
      { path: 'paijian', component: PaijianComponent },
      {
        path: 'empKufang', component: EmpKufangComponent ,
        children: [
          {path: 'wuliaofafang', component: WuliaofafangComponent },
          {path: 'rukuManage', component: RukuManageComponent },
          {path: 'beipinmsg', component: BeipinmsgComponent },
          {path: 'changshangmsg', component: ChangshangmsgComponent },
          { path: '**', redirectTo: 'wuliaofafang' }
        ]
      },
      { path: 'lingliao', component: LingliaoComponent},
      {
        path: 'kanbanManage', component: KanbanManageComponent,
        children: [
          {path: 'zongjihua', component: ZongjihuaComponent},
          {path: 'designProcess', component: DesignProcessComponent},
          {path: 'programProcess', component: ProgramProcessComponent},
          {path: 'jiagongProcess', component: JiagongProcessComponent},
          {path: 'zuzhuangProcess', component: ZuzhuangProcessComponent},
          {path: 'pinjianProcess', component: PinjianProcessComponent},
          {path: 'beiliaoProcess', component: BeiliaoProcessComponent},
          {path: 'zongjianProcess', component: ZongjianProcessComponent},
          {path: '**', redirectTo: 'zongjihua'},
        ]
      },
      { path: 'baobiao', component: BaobiaoComponent},
      {
        path: 'paiban', component: PaibanComponent,
        children: [
          { path: 'autoPaiban', component: AutoPaibanComponent},
          { path: 'addtask', component: AddtaskComponent},
          { path: 'paibanset', component: PaibansetComponent},
          { path: 'zhijvleixingset', component: ZhijvleixingsetComponent},
          { path: '**', redirectTo: 'autoPaiban'}
        ]
      },
      {
        path: 'permissions', component: PermissionsComponent,
        children: [
          { path: 'permissions-userinfo', component: PermissionsUserinfoComponent },
          { path: 'permissions-CNC', component: PermissionsCNCComponent },
          { path: 'permissions-CNCjiagong', component: PermissionsCNCjiagongComponent },
          { path: 'zjfs', component: ZjfsComponent },
          { path: 'lirun', component: LirunComponent },
          { path: '**', redirectTo: 'permissions-userinfo' }
        ]
      },
      { path: '**', redirectTo: 'audit' }
    ]
  },
  { path: 'CNC', component: CNCComponent },
  { path: 'zhijianChild', component: ZhijianChildComponent },
  { path: '**', redirectTo: 'login' }
];





@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
